package controllers

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

type UserController struct {
}

func NewUser() *UserController {
	return &UserController{}
}
func (_this *UserController) AddRecord(ctx *gin.Context) {
	ctx.JSON(http.StatusOK, "添加新纪录")
}

func (_this *UserController) RemoveRecord(ctx *gin.Context) {
	ctx.JSON(http.StatusOK, "删除新纪录")
}

func (_this *UserController) UpdateRecord(ctx *gin.Context) {
	ctx.JSON(http.StatusOK, "更新新纪录")
}

func (_this *UserController) QueryRecords(ctx *gin.Context) {
	ctx.JSON(http.StatusOK, "查询新纪录")
}

func (_this *UserController) Login(ctx *gin.Context) {

}
func (_this *UserController) Register(ctx *gin.Context) {

}
func (_this *UserController) SetupRoutes(engine *gin.Engine) {
	user := engine.RouterGroup.Group("user")
	{
		user.GET("add", _this.AddRecord)
		user.GET("del", _this.RemoveRecord)
		user.GET("edit", _this.UpdateRecord)
		user.GET("query", _this.QueryRecords)
	}
	engine.POST("login", _this.Login)
	engine.POST("register", _this.Register)
}
